Fix broken width computation, again.
authorBehdad Esfahbod <behdad@gnome.org>
Fri, 5 Jan 2007 18:05:15 +0000 (18:05 +0000)
committerBehdad Esfahbod <behdad@src.gnome.org>
Fri, 5 Jan 2007 18:05:15 +0000 (18:05 +0000)
2007-01-05  Behdad Esfahbod  <behdad@gnome.org>

        * gtk/gtklabel.c (get_layout_location): Fix broken width computation,
        again.

svn path=/trunk/; revision=17083

ChangeLog
gtk/gtklabel.c

index 7dfb7327b260a391fac5855b3f65c489dcc627e8..453924e48010b2391140816918cfa1c88abab8eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-05  Behdad Esfahbod  <behdad@gnome.org>
+
+       * gtk/gtklabel.c (get_layout_location): Fix broken width computation,
+       again.
+
 2007-01-05  Carlos Garnacho  <carlosg@gnome.org>
 
        * gtk/gtknotebook.c (gtk_notebook_size_request): take into account
index 219f01e898bdd53a35561ca7e068ea13679b6ee0..e479bf439102299968c564405a1061187280512a 100644 (file)
@@ -2301,8 +2301,9 @@ get_layout_location (GtkLabel  *label,
       width = pango_layout_get_width (label->layout);
       pango_layout_get_pixel_extents (label->layout, NULL, &logical);
 
-      /* width may be -1 */
-      req_width = MIN(PANGO_PIXELS (width), logical.width);
+      req_width = logical.width;
+      if (width != -1)
+       req_width = MIN(PANGO_PIXELS (width), req_width);
       req_width += 2 * misc->xpad;
     }
   else